/* Copyright (c) 2006 GCCSDK Developers
 *
 * Example module using GCC and showing how to use 'resgen'.
 */

#include <stdio.h>
#include <oslib/resourcefs.h>

#include "module.h" // Generated by CMHG or CMUNGE

// NOTE: registering the data at resourcefsdata() needs also be done
// at Service_ResourceFSStarting (&60) time.  This is omited from this
// example.

// The following routine is defined in resgen.o (which is generated by
// resgen) :
const resourcefs_file_list *resourcefsdata (void);

_kernel_oserror *
gccmodule_init (const char *cmd_tail, int podule_base, void *pw)
{
  puts ("GCC example module initialise");

  return (_kernel_oserror *)xresourcefs_register_files (resourcefsdata ());
}

_kernel_oserror *
gccmodule_final (int fatal, int podule, void *pw)
{
  puts ("GCC example module finalise");

  return (_kernel_oserror *)xresourcefs_deregister_files (resourcefsdata ());
}
